import { GetServerSideProps, NextPage, PageConfig } from 'next';
import Head from 'next/head';
import Content from './content';
import { Query as Q1 } from '../../api/basicinformation/major/query.api';


interface IProps {
	initQuery: Q1;
}

/**
 * 专业管理
 */
const Page: NextPage<IProps> = ({ initQuery }) => {
	return (
		<>
			<Head>
				<title>专业管理</title>
			</Head>
			<Content contition={initQuery} />
		</>
	);
};

export const config: PageConfig = {
	amp: false
};

export default Page;

export const getServerSideProps: GetServerSideProps<IProps> = async (context) => {
	const query = context.query as Record<string, string>;
	return {
		props: {
			initQuery: {
				page: query.page || '1',
				pagesize: query.pagesize || '10',
				q: query.q || ''
			}
		}
	};
};

